// ===== 1. 通用容器和布局 =====
.container {
  width: 100%;
  background-color: var(--white);
  border-radius: 8px;
  box-shadow: var(--card-shadow, 0 1px 3px rgba(0, 0, 0, 0.1));
  overflow: hidden;
}

// 动画效果
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fadeIn {
  animation: fadeIn 0.3s ease-out;
}

// 在适当位置添加
.balanceButton {
  background-color: #ECFDF5 !important;
  color: #047857 !important;
  border-color: #A7F3D0 !important;
  
  &:hover {
    background-color: #D1FAE5 !important;
  }
}
// ===== 2. 头部和导航 =====
// 头部样式
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-in-light);

  .headerLeft {
    display: flex;
    align-items: center;
    gap: 16px;
  }

  h1 {
    font-size: 18px;
    font-weight: 600;
    color: var(--black);
    margin: 0;
  }

  .providerCount {
    font-size: 14px;
    margin-top: 4px;
  }
}

// 操作按钮
.actions {
  display: flex;
  gap: 8px;
}

// 步骤导航
.stepsContainer {
  display: flex;
  justify-content: center;
  padding: 0 10px;
  margin-bottom: 5px;
  margin-top: -2px;
}

.steps {
  display: flex;
  gap: 40px;
  padding: 3px 0;
  position: relative;
  
  &::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 40px;
    right: 40px;
    height: 2px;
    background-color: var(--border-color);
    z-index: 0;
    transform: translateY(-50%);
  }
}

.stepItem {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
  cursor: pointer;
  
  &.active {
    .stepNumber {
      background-color: var(--primary);
      color: var(--white);
      border-color: var(--primary);
    }
    
    .stepText {
      color: var(--primary);
      font-weight: 500;
    }
  }
  
  &.disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }
}

.stepNumber {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 500;
  border: 2px solid var(--black);
  transition: all 0.3s ease;
}

.stepText {
  font-size: 14px;
  transition: all 0.3s ease;
}

// ===== 3. 搜索和过滤 =====
// 搜索框
.searchContainer {
  padding: 16px 24px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;

  .searchInput {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    
    &::placeholder {
      color: #6b7280;
    }
    
    &:focus {
      outline: none;
      border-color: #2563eb;
      box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
    }
  }
  
  .searchIcon, .clearButton {
    position: static;
    transform: none;
  }
  .searchInput {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    
    &::placeholder {
      color: #6b7280;
    }
    
    &:focus {
      outline: none;
      border-color: #2563eb;
      box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
    }
  }
}
// 为移动设备添加响应式样式
@media screen and (max-width: 768px) {
  .searchContainer {
    flex-direction: column;
    gap: 8px;
  
    .searchInput {
      margin-bottom: 8px;
    }
  }
}
.provider-filter {
  display: flex;
  padding: 16px 24px;
  border-bottom: 1px solid #e5e7eb;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap; // 允许换行
  gap: 8px;

  .search-bar {
    flex-grow: 1;
    min-width: 200px;
    padding: 10px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    max-width: unset;
  }

  .actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;

    button {
      flex-shrink: 0;
    }
  }

  @media screen and (max-width: 768px) {
    flex-direction: column;
    align-items: stretch;

    .search-bar {
      width: 100%;
      margin-right: 0;
    }

    .actions {
      width: 100%;
      margin-top: 8px;
      justify-content: space-between;

      button {
        flex: 1;
      }
    }
  }
}

// 模型过滤
.modelFilter {
  display: flex;
  margin-bottom: 16px;
  
  .searchBar {
    max-width: unset;
    flex-grow: 1;
    margin-right: 10px;
    padding: 10px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    
    &:focus {
      outline: none;
      border-color: #2563eb;
      box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
    }
  }
  
  .actions {
    display: flex;
    button:not(:last-child) {
      margin-right: 10px;
    }
  }
  
  @media screen and (max-width: 768px) {
    flex-direction: column;
    .searchBar {
      margin-right: 0;
      margin-bottom: 10px;
    }
    .actions {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 0;
      width: 100%;

      button,
      .icon-button {
        flex: 1 1 48%; 
        min-width: 120px; 
        max-width: 100%;
        margin-right: 0 !important;
        margin-bottom: 4px;
        font-size: 15px;
        white-space: normal;
        word-break: break-all;
      }
    }
  }
}

.modelSearchRow {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-bottom: 16px;
}

.modelSearchInput {
  flex: 1;
  
  input {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    
    &:focus {
      outline: none;
      border-color: #2563eb;
      box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
    }
  }
}

// ===== 4. 提供商列表展示 =====
.providerList {
  padding: 0 24px;
  max-height: calc(100vh - 300px); // 设置最大高度，根据实际页面布局调整
  overflow-y: auto; // 添加垂直滚动

  .providerItem {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin: 16px 0;
    transition: transform 0.2s, box-shadow 0.2s;
    
    &:hover {
      // transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    }

    .providerInfo {
      display: flex;
      align-items: center;
      gap: 16px;

      .providerIcon {
        width: 40px;
        height: 40px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: #eef2ff;
        color: #2563eb;
      }

      .providerName {
        font-weight: 600;
        font-size: 16px;
      }
      
      .providerMeta {
        display: flex;
        gap: 12px;
        margin-top: 6px;
        flex-wrap: wrap;
        
        .metaItem {
          display: flex;
          align-items: center;
          gap: 4px;
          font-size: 12px;
          color: #6b7280;
          background-color: #f3f4f6;
          padding: 2px 8px;
          border-radius: 4px;
        }
      }
    }

    .providerActions {
      display: flex;
      gap: 8px;
      opacity: 0.8;
      transition: opacity 0.2s;
      flex-wrap: wrap;
      
      &:hover {
        opacity: 1;
      }
    }
  }
  
  .emptyState {
    padding: 40px 20px;
    text-align: center;
    color: #6b7280;
    
    .emptyIcon {
      font-size: 48px;
      color: #d1d5db;
      margin-bottom: 16px;
    }
    
    .emptyTitle {
      font-size: 16px;
      font-weight: 500;
      margin-bottom: 8px;
    }
    
    .emptyDescription {
      font-size: 14px;
      color: #9ca3af;
      max-width: 300px;
      margin: 0 auto;
    }
  }
}
@media screen and (max-width: 768px) {
  .providerList {
    padding: 0 4vw;

    .providerItem {
      flex-direction: column;
      align-items: stretch;
      gap: 8px;
      padding: 12px 8px;

      .providerInfo {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
      }

      .providerActions {
        justify-content: flex-start;
        gap: 6px;
        flex-wrap: wrap;
        margin-top: 6px;
      }
    }
  }
}

// 状态切换容器
.statusToggleContainer {
  display: flex;
  align-items: center;
  gap: 8px;
  
  span {
    font-size: 14px;
    font-weight: 500;
  }
}
@media screen and (max-width: 768px) {
  .providerActions {
    button, .icon-button {
      min-width: 36px;
      min-height: 32px;
      font-size: 13px;
      padding: 4px 6px;
    }
  }
  .statusToggleContainer {
    gap: 4px;
  }
}

// 开关按钮样式
.toggleSwitch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background-color: #e5e7eb;
  cursor: pointer;
  transition: background-color 0.3s;
  
  &.active {
    background-color: var(--primary);
  }
  
  .toggleSlider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--white);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: 0.3s;
  }
  
  &.active .toggleSlider {
    transform: translateX(20px);
  }
}

// 切换开关容器
.toggleContainer {
  display: flex;
  align-items: center;
  gap: 8px;
}
// 切换开关标签
.toggleLabel {
  font-size: 14px;
  color: var(--black);
}
// 如果需要，可以添加描述输入框的特殊样式
.descriptionInput {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 14px;
  min-width: 400px;
  
  &:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
  }
}
// 视觉支持行样式 - 使标签和开关在同一行
.visionSupportRow {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  
  label {
    margin-right: 12px;
    min-width: auto; // 防止标签占用过多空间
    margin-bottom: 0; // 移除底部边距
  }
  
  .toggleContainer {
    display: flex;
    align-items: center;
    gap: 8px;
  }
}
// 操作区中的开关容器样式调整
.providerActions {
  .statusToggleContainer {
    margin-right: 4px;
  }
  
  // 可以根据需要调整开关在操作区的大小
  .toggleSwitch {
    width: 40px;
    height: 22px;
    
    .toggleSlider {
      width: 18px;
      height: 18px;
    }
    
    &.active .toggleSlider {
      transform: translateX(18px);
    }
  }
}

// ===== 5. 模态框和表单 =====
// 模态框样式
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;

  .modalContent {
    width: 100%;
    max-width: 900px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
  }

  .modalHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px 10px;
    border-bottom: 1px solid #e5e7eb;

    h2 {
      font-size: 18px;
      font-weight: 600;
      margin: 0;
    }

    .closeButton {
      background: none;
      border: none;
      cursor: pointer;
      font-size: 20px;
      color: #6b7280;
    }
  }
}

.modalContainer {
  // 步骤导航
  .steps {
    display: flex;
    margin: 0 0 20px 0;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-in-light);
    gap: 12px;
  }
  
  .stepItem {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 8px;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    
    &.active {
      background-color: var(--primary);
      color: var(--white);
      font-weight: 500;
    }
    
    &.disabled {
      opacity: 0.6;
      cursor: not-allowed;
    }
    
    .stepNumber {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 20px;
      height: 20px;
      border-radius: 50%;
      margin-right: 10px;
      font-size: 12px;
      font-weight: 500;
      
      .active & {
        background-color: var(--white);
        color: var(--primary);
      }
      
      .disabled & {
        background-color: var(--secondary);
        color: var(--white);
      }
    }
  }
}

// 表单样式
.form {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px;
  margin-top: 0;
}

.formStep {
  padding: 6px 0;
  max-height: 60vh;
}

// ===== 6. 模型选择和配置 =====
.modelPullContainer {
  padding: 0 20px 20px;
}

.modelListContainer {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  min-height: 250px;
  max-height: calc(70vh - 120px); // Add max-height for maximized view
  overflow-y: auto;
  margin-bottom: 20px;
}

.modelGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  max-height: none;
  overflow-y: visible;
  padding: 8px 0;
}

.modelItem {
  padding: 12px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  height: 100px;
  box-sizing: border-box;
  
  &:hover {
    border-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.1);
  }
  
  &.selected {
    border-color: #2563eb;
    background-color: rgba(37, 99, 235, 0.3);
  }
}

.modelName {
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 8px;
  // color: var(--white);
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  display: -webkit-box;
  -webkit-line-clamp: 2; // Limit to 2 lines
  -webkit-box-orient: vertical;
  word-break: break-all; // Allow word wrapping
  min-height: 36px; // Add minimum height for two lines
}

.modelType {
  font-size: 12px;
  color: #6b7280;
  background-color: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}

.customModelSection {
  margin-top: 20px;
  border-top: 1px solid #e5e7eb;
  padding-top: 20px;
  
  h3 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 16px;
    color: #111827;
  }
}

// ===== 7. 加载和空状态 =====
.loadingState {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
  
  .spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 3px solid #2563eb;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
  }
  
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
}

.loadingModels {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: #6b7280;
  gap: 16px;
}

.emptyModels {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: #6b7280;
  text-align: center;
  
  .emptyIcon {
    font-size: 40px;
    color: #d1d5db;
    margin-bottom: 16px;
  }
  
  p {
    margin: 4px 0;
    
    &:first-of-type {
      font-size: 16px;
      font-weight: 500;
    }
    
    &:last-of-type {
      font-size: 14px;
      color: #9ca3af;
    }
  }
}

// ===== 8. 底部操作区 =====
.footer {
  display: flex;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
  gap: 8px;
}

// ===== 9. 响应式设计 =====
@media screen and (max-width: 768px) {
  .modelSearchRow {
    flex-direction: column;
    
    .modelSearchInput {
      width: 100%;
    }
  }
  
  .modelGrid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
  }
  
  .modal .modalContent {
    width: 95%;
    max-height: 80vh;
  }
  
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    
    .actions {
      align-self: flex-end;
    }
  }
}

// ===== 10. 智能解析 =====
.intelligentParsingContainer {
  padding: 0 24px 16px;
  margin-top: 10px;
  position: relative;
  box-sizing: border-box;
}
.parsingTextarea {
  width: 100%;
  min-height: 100px;
  padding: 10px 16px 40px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  resize: vertical;
  box-sizing: border-box;
  
  &:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
  }
}
.parsingButtonContainer {
  position: absolute;
  bottom: 26px;
  right: 34px;
  z-index: 1;
}
// 添加模型内容布局
.modelContent {
  display: flex;
  justify-content: space-between;
  flex-direction: column;
  align-items: center;
}
.modelName {
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--black);
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: 36px;
  flex: 1;
}
// 添加编辑图标样式
.modelEditIcon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: #6b7280;
  cursor: pointer;
  margin-left: 6px;
  opacity: 0.6;
  transition: opacity 0.2s;
  
  &:hover {
    opacity: 1;
    color: #2563eb;
  }
}

// 模型测试图标
.modelTestIcon, .visionToggle, .modelEditButton, .placeholderItem {
  flex-shrink: 0;
  font-size: 12px;
  cursor: pointer;
  padding: 1px 1px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background-color: #f3f4f6;
  color: #6b7280;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px; // 减少最小宽度
  max-width: 48px; // 限制最大宽度
  overflow: hidden; // 超出部分隐藏
  text-overflow: ellipsis; // 超出显示省略号
  white-space: nowrap; // 防止文本换行
  
  &:hover {
    background-color: #e5e7eb;
    border-color: #9ca3af;
  }
  
  &.testing {
    background-color: #dbeafe;
    color: #2563eb;
    border: 1px solid #93c5fd;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.1);
  }
  
  &.success {
    background-color: #d1fae5;
    color: #059669;
    border: 1px solid #6ee7b7;
    box-shadow: 0 0 0 1px rgba(5, 150, 105, 0.1);
  }
  
  &.error {
    background-color: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.1);
    font-weight: 500;
  }
}
// 测试结果文本
.testResult {
  font-size: 10px;
  font-family: monospace;
  white-space: nowrap;
}
// 测试图标
.testIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.modelFooter {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  flex-wrap: wrap;
  gap: 4px;
}

// 添加编辑名称模态框样式
.editNameModal {
  background-color: var(--white);
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 10px 15px rgba(0, 0, 0, 0.1);
  width: 500px;
  max-width: 90vw;
  overflow: hidden;
}
.editNameHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
  
  h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
  }
  
  .closeButton {
    cursor: pointer;
    color: #6b7280;
    
    &:hover {
      color: #111827;
    }
  }
}
.editNameContent {
  padding: 20px;
}
.editNameRow {
  margin-bottom: 16px;
  
  label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--black);
  }
  
  .modelIdText {
    font-size: 14px;
    color: var(--black);
    padding: 8px 0;
    word-break: break-all;
  }
  
  .displayNameInput {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    min-width: 400px;
    
    &:focus {
      outline: none;
      border-color: #2563eb;
      box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
    }
  }

  @media screen and (max-width: 768px) {
    .editNameModal {
      width: 95vw;
    }
    
    .editNameContent {
      padding: 16px;
    }
    
    .displayNameInput {
      font-size: 15px;
      min-width: 300px;
      box-sizing: border-box;
    }
    
    .visionSupportRow {
      align-items: flex-start;
      
      label {
        margin-bottom: 6px;
      }
      
      .toggleContainer {
        align-self: flex-start;
      }
    }
  }
}

.editNameFooter {
  display: flex;
  justify-content: flex-end;
  padding: 12px 20px;
  border-top: 1px solid #e5e7eb;
  gap: 8px;
  
  button {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
  }
  
  .cancelButton {
    background: none;
    border: 1px solid #e5e7eb;
    color: var(--black);
    
    &:hover {
      background-color: #f3f4f6;
    }
  }
  
  .saveButton {
    background-color: var(--primary, #2563eb);
    color: var(--white);
    border: none;
    
    &:hover {
      opacity: 0.9;
    }
  }
}

// ===== 11. Key List View =====
.keyListContainer {
  width: 100%;
  box-sizing: border-box;
  padding: 0 24px;
}
.keyInputContainer {
  display: flex;
  margin-bottom: 16px;
  width: 100%;
  
  .keyInput {
    max-width: unset;
    flex-grow: 1;
    margin-right: 10px;
    padding: 10px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    
    &:focus {
      outline: none;
      border-color: #2563eb;
      box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
    }
  }
  
  .actions {
    display: flex;
    
    button:not(:last-child) {
      margin-right: 10px;
    }
  }
  
  @media screen and (max-width: 768px) {
    flex-direction: column;
    
    .keyInput {
      margin-right: 0;
      margin-bottom: 10px;
    }
    
    .actions {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 0;
      width: 100%;
      button,
      .icon-button {
        flex: 1 1 48%; 
        min-width: 120px; 
        max-width: 100%;
        margin-right: 0 !important;
        margin-bottom: 8px;
        font-size: 15px;
        white-space: normal;
        word-break: break-all;
      }
      // button:last-child,
      // .icon-button:last-child {
      //   margin-bottom: 0;
      // }
    }
  }
}
.keyListScroll {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 4px;
  background-color: #f9fafb;
}
.emptyKeys {
  padding: 16px;
  text-align: center;
  color: #6b7280;
  font-size: 14px;
}
.keyList {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.keyItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background-color: var(--second);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  transition: all 0.2s;
  
  .keyContent {
    display: flex;
    align-items: center;
    gap: 8px;
    
    .keyText {
      font-family: monospace;
      font-size: 14px;
      word-break: break-all;
    }
  }
  
  .keyActions {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .keyDeleteIcon {
    color: #6b7280;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s, color 0.2s;
    
    &:hover {
      opacity: 1;
      color: #ef4444;
    }
  }
  .balanceDisplay {
    font-size: 12px;
    color: #059669;
    padding: 2px 8px;
    background-color: #d1fae5;
    border-radius: 4px;
    margin-right: 8px;
  }
}
// Add animation for key items
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.keyItem {
  animation: slideIn 0.2s ease-out;
}
// Customize scrollbar for key list
.keyListScroll {
  &::-webkit-scrollbar {
    width: 6px;
  }
  
  &::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
  }
  
  &::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
  }
  
  &::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
  }
}
// Responsive styles for key list view
@media screen and (max-width: 768px) {
  .keyInputContainer {
    flex-direction: column;
  }
}

@media screen and (max-width: 768px) {
  .keyListContainer {
    padding: 0 2vw;
  }
  .keyInputContainer {
    flex-direction: column;
    gap: 6px;
    .keyInput {
      min-width: 0;
      width: 100%;
      font-size: 15px;
    }
  }
  .keyListScroll {
    max-height: 40vw;
    min-height: 80px;
    padding: 2px;
  }
  .keyItem {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 8px 6px;
    .keyContent {
      gap: 4px;
      .keyText {
        font-size: 13px;
      }
    }
    .balanceDisplay {
      font-size: 11px;
      padding: 2px 6px;
      margin-right: 0;
      margin-bottom: 2px;
    }
    .keyActions {
      gap: 2px;
    }
  }
}
// Update these styles in custom-provider.module.scss
.testConfigContainer {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  padding: 10px;
  background-color: #f9fafb;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}

.testModelLabel {
  margin-right: 10px;
  font-size: 14px;
  color: #374151;
  white-space: nowrap;
}

.testModelInput {
  flex: 1;
  padding: 8px 10px;
  margin-right: 10px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 14px;
}
// Update the test result styles in custom-provider.module.scss
.testResult {
  margin-left: 8px;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  font-weight: 500;
}

.testSuccess {
  color: #047857;
  background-color: #ecfdf5;
}

.testError {
  color: #b91c1c;
  background-color: #fef2f2;
}
